home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
3_7.lha
/
3_7
/
3_7f.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
587b
|
27 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Compare two strings. Return <0, >0 or 0
/ when the first string is lexically
/ less than, greater than, or equal to
/ the second, respectively.
nt strcmp(const char *s1, const char *s2)
if (s1 && s2)
{
while (*s1)
if (*s1++ != *s2++)
ifdef TSTG /* DELETE */
include "3_7g.c" /* DELETE */
else /* DELETE */
return s1[-1] - s2[-1];
endif /* DELETE */
return *s1 - *s2;
}
else
error("NULL pointer encountered");